
#ifndef __DRV_WS2812B_H
#define __DRV_WS2812B_H

#include "stdint.h"

typedef union WS2812_ARGB
{
    struct
    {
        uint8_t b;
        uint8_t g;
        uint8_t r;
        uint8_t a;
    }s_argb;
    uint32_t u32_rgba;
}WS2812_ARGB_U;



#define WS2812_PIXELS           64u         // How many WS2812 LEDs on the trip

#define WS2812_SPI              SPI1        // WS2812 SPI Handler

#define WS2812_RED              0xFF0000
#define WS2812_GREEN            0x00FF00
#define WS2812_BLUE             0x0000FF
#define WS2812_ORANGE           0xFF1000
#define WS2812_YELLOW           0xFFFF00
#define WS2812_CYAN             0x00FFFF
#define WS2812_PURPLE           0xFF00FF
#define WS2812_WHITE            0xFFFFFF
#define WS2812_BLACK            0x000000

extern void WS2812_Init(void);
extern void WS2812_PixelSetIndexColor(uint16_t n, uint32_t color);
extern void WS2812_PixelSetIndexRGB(uint16_t n, uint8_t r, uint8_t g, uint8_t b);
extern void WS2812_ClearData(void);
extern void WS2812_SendData(void);

extern void WS2812_ShowRGB(uint8_t r,uint8_t g,uint8_t b);
extern void WS2812_ShowColor(uint32_t color);
extern void WS2812_ShowBuff(uint8_t *buff);


#endif


